<html>
<head><meta charset="utf-8"><title>Encode spans relative to the enclosing it… compiler-team#443 · t-compiler/major changes · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/index.html">t-compiler/major changes</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Encode.20spans.20relative.20to.20the.20enclosing.20it.E2.80.A6.20compiler-team.23443.html">Encode spans relative to the enclosing it… compiler-team#443</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="244315239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/Encode%20spans%20relative%20to%20the%20enclosing%20it%E2%80%A6%20compiler-team%23443/near/244315239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> triagebot <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Encode.20spans.20relative.20to.20the.20enclosing.20it.E2.80.A6.20compiler-team.23443.html#244315239">(Jun 29 2021 at 17:12)</a>:</h4>
<p>A new proposal has been announced: <a href="https://github.com/rust-lang/compiler-team/issues/443">Encode spans relative to the enclosing item #443</a>. It will be announced at the next meeting to try and draw attention to it, but usually MCPs are not discussed during triage meetings. If you think this would benefit from discussion amongst the team, consider proposing a design meeting.</p>



<a name="244438726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/Encode%20spans%20relative%20to%20the%20enclosing%20it%E2%80%A6%20compiler-team%23443/near/244438726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Encode.20spans.20relative.20to.20the.20enclosing.20it.E2.80.A6.20compiler-team.23443.html#244438726">(Jun 30 2021 at 15:10)</a>:</h4>
<p>I like the idea of this, but I'm concerned about adding more complexity to the incr comp system at a time when we're still fixing bugs</p>



<a name="244542589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/Encode%20spans%20relative%20to%20the%20enclosing%20it%E2%80%A6%20compiler-team%23443/near/244542589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Encode.20spans.20relative.20to.20the.20enclosing.20it.E2.80.A6.20compiler-team.23443.html#244542589">(Jul 01 2021 at 09:58)</a>:</h4>
<p>This being an MCP now will hopefully allow me to prioritize looking into this in detail.</p>



<a name="244768709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/Encode%20spans%20relative%20to%20the%20enclosing%20it%E2%80%A6%20compiler-team%23443/near/244768709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cjgillot <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Encode.20spans.20relative.20to.20the.20enclosing.20it.E2.80.A6.20compiler-team.23443.html#244768709">(Jul 02 2021 at 23:48)</a>:</h4>
<p><span class="user-mention" data-user-id="125294">@Aaron Hill</span> I understand and share your concern.<br>
For now, I proposed the simplest implementation, without any stability guarantee.<br>
I can use an unstable option to get a staging ground until all bugs are ironed out.</p>



<a name="244910973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/Encode%20spans%20relative%20to%20the%20enclosing%20it%E2%80%A6%20compiler-team%23443/near/244910973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Encode.20spans.20relative.20to.20the.20enclosing.20it.E2.80.A6.20compiler-team.23443.html#244910973">(Jul 05 2021 at 09:03)</a>:</h4>
<p>The MCP mentions storing <code>LocalDefId</code> in <code>Span</code>. How does this work when dealing with cross-crate scenarios, like when doing MIR inlining and we inline a function from an upstream crate?</p>



<a name="244913781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/Encode%20spans%20relative%20to%20the%20enclosing%20it%E2%80%A6%20compiler-team%23443/near/244913781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Encode.20spans.20relative.20to.20the.20enclosing.20it.E2.80.A6.20compiler-team.23443.html#244913781">(Jul 05 2021 at 09:32)</a>:</h4>
<p>in HIR that is irrelevant, you can't have Spans in HIR that point to other crates I believe?</p>



<a name="244913804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/Encode%20spans%20relative%20to%20the%20enclosing%20it%E2%80%A6%20compiler-team%23443/near/244913804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Encode.20spans.20relative.20to.20the.20enclosing.20it.E2.80.A6.20compiler-team.23443.html#244913804">(Jul 05 2021 at 09:33)</a>:</h4>
<p>but once we move to THIR and then MIR, we need to wrap this in more information</p>



<a name="244932288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/Encode%20spans%20relative%20to%20the%20enclosing%20it%E2%80%A6%20compiler-team%23443/near/244932288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Encode.20spans.20relative.20to.20the.20enclosing.20it.E2.80.A6.20compiler-team.23443.html#244932288">(Jul 05 2021 at 12:53)</a>:</h4>
<p>Right now item-relative spans is only an optimization, it's enabled for some spans that look "optimizable enough", but it's ok to not enable it for other spans.<br>
So it's never enabled for foreign spans now.</p>



<a name="246352144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/Encode%20spans%20relative%20to%20the%20enclosing%20it%E2%80%A6%20compiler-team%23443/near/246352144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> triagebot <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Encode.20spans.20relative.20to.20the.20enclosing.20it.E2.80.A6.20compiler-team.23443.html#246352144">(Jul 18 2021 at 00:46)</a>:</h4>
<p><span class="user-group-mention" data-user-group-id="492">@T-compiler</span>: Proposal <a href="https://github.com/rust-lang/compiler-team/issues/443#issuecomment-881979632">#443</a> has been seconded, and will be approved in 10 days if no objections are raised.</p>



<a name="247795087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/Encode%20spans%20relative%20to%20the%20enclosing%20it%E2%80%A6%20compiler-team%23443/near/247795087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> triagebot <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/Encode.20spans.20relative.20to.20the.20enclosing.20it.E2.80.A6.20compiler-team.23443.html#247795087">(Jul 31 2021 at 09:15)</a>:</h4>
<p>This proposal has been accepted: <a href="https://github.com/rust-lang/compiler-team/issues/443">#443</a>.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>